@extends('layouts.master')

@section('title')
   钢厂录入——钢链网管理后台
@stop

@section('app_css')
    <link rel="stylesheet" href="/resource/css/bootstrap.min.css">
    <link rel="stylesheet" href="/resource/css/font-awesome.min.css">
    <link rel="stylesheet" href="/resource/css/animate.min.css">
    <link rel="stylesheet" href="/resource/css/custom.css">
    <link rel="stylesheet" href="/resource/css/green.css">
    <link rel="stylesheet" href="/resource/css/fileinput.min.css">
@stop

@section('app_js')
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/resource/js/jquery.min.js"></script>
    <script src="/resource/js/bootstrap.min.js"></script>
    <script src="/resource/js/custom.js"></script>
    <!-- icheck -->
    <script src="/resource/js/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="/resource/js/jquery.dataTables.js"></script>
    <script src="/resource/js/J_main.js"></script>
    <!-- 添加图片 -->
    <script src="/resource/js/fileinput.min.js"></script>
    <script src="/resource/js/fileinput_locale_zh.js"></script>
    <!-- 编辑器 -->
    <script src="/resource/js/umeditor.config.js" charset="utf-8"></script>
    <script src="/resource/js/umeditor.min.js" charset="utf-8"></script>
    <script src="/resource/js/lang/zh-cn/zh-cn.js"></script>
    {{--联动--}}
    <script src="/resource/js/province_city.js"></script>
    <script>
        var um = UM.getEditor('editor');
        //联动
        region_init("pro","city","coun");
        var hid = $('#hid').val();
        var arr = [];
        arr = hid.split('-');
        region_init("pro","city","coun",arr[0],arr[1],arr[2]);
    </script>
    <link rel="stylesheet" href="/resource/js/themes/default/css/umeditor.css">
@stop

@section('content')
    <body class="nav-md">

    <div class="container body">


        <div class="main_container">

            @include('common.admin_menu')

            <!-- top navigation -->
            @include('common.admin_nav')
            <!-- /top navigation -->


            <!-- page content -->
            <div class="right_col" role="main">

                <div class="">

                    <div class="row cont">

                        <div class="col-md-6 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>钢厂录入 <small>钢厂</small></h2>
                                    <div class="clearfix"></div>
                                </div>

                                <div class="x_content">
                                    <br />
                                    @if(empty($factory))
                                    {{ Form::open(['url'=>'/admin/factory_edit', 'files' => true, 'method' => 'post']) }}
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">钢厂名称
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="factory_name">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">联系人
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="contact_name">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">电话
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="last-name" name="phone" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">钢厂地址
                                            </label>
                                            <div class="col-md-3 col-sm-10 col-xs-12">
                                                <select name="pro" id="pro" class="form-control col-md-7 col-xs-12"></select>
                                            </div>
                                            <div class="col-md-4 col-sm-10 col-xs-12">
                                                <select name="city" id="city" class="form-control col-md-7 col-xs-12"></select>
                                            </div>
                                            <div class="col-md-3 col-sm-10 col-xs-12">
                                                <select name="coun" id="coun" class="form-control col-md-7 col-xs-12"></select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">详细地址
                                            </label>

                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="last-name" name="address" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">email
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="last-name" name="email" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">邮编
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="last-name" name="postcord" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">备注
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <textarea name="remarks" class="form-control col-md-7 col-xs-12"></textarea>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">图标</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="picture">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">是否推荐到首页</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                               <select name="recommend" class="form-control col-md-7 col-xs-12">
                                                    <option value="0">否</option>
                                                    <option value="1">是</option>
                                               </select>
                                            </div>
                                        </div>


                                        <div class="ln_solid"></div>
                                        <div class="form-group">
                                            <div class="col-md-10 col-sm-10 col-xs-12 col-md-offset-3">
                                                <button type="submit" class="btn btn-primary">取消</button>
                                                <button type="submit" class="btn btn-success">提交</button>
                                            </div>
                                        </div>

                                    {{ Form::close() }}
                                        @else
                                        {{ Form::open(['url'=>'admin/factory_edit', 'files' => true, 'method' => 'post']) }}
                                        <input type="hidden" value="{{$factory->picture}}" name="picture_old">
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">钢厂名称
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" value="{{$factory->factory_name}}" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="factory_name" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">联系人
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" value="{{$factory->contact_name}}" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="contact_name">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">电话
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" value="{{$factory->phone}}" id="last-name" name="phone" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                        <input type="hidden" id="hid" name="hid" value="{{$factory->place}}">
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">钢厂地址
                                            </label>
                                            <div class="col-md-3 col-sm-10 col-xs-12">
                                                <select name="pro" id="pro" class="form-control col-md-7 col-xs-12"></select>
                                            </div>
                                            <div class="col-md-4 col-sm-10 col-xs-12">
                                                <select name="city" id="city" class="form-control col-md-7 col-xs-12"></select>
                                            </div>
                                            <div class="col-md-3 col-sm-10 col-xs-12">
                                                <select name="coun" id="coun" class="form-control col-md-7 col-xs-12"></select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">详细地址
                                            </label>

                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" value="{{$factory->address}}" id="last-name" name="address" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">email
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" value="{{$factory->email}}" id="last-name" name="email" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">邮编
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" value="{{$factory->postcord}}" id="last-name" name="postcord" required="required" class="form-control col-md-7 col-xs-12" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">备注
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <textarea name="remarks" class="form-control col-md-7 col-xs-12">{{$factory->remarks}}</textarea>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">图标</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <img src="{{$factory->picture}}" width="330">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="picture">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">是否推荐到首页</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <select name="recommend" class="form-control col-md-7 col-xs-12">
                                                    <option value="0" @if($factory->recommend == 0) selected="selected" @else @endif>否</option>
                                                    <option value="1" @if($factory->recommend == 1) selected="selected" @else @endif>是</option>
                                                </select>
                                            </div>
                                        </div>
                                        <input type="hidden" name="factory_id" value="{{$factory->factory_id}}" >
                                        <div class="ln_solid"></div>
                                        <div class="form-group">
                                            <div class="col-md-10 col-sm-10 col-xs-12 col-md-offset-3">
                                                <button type="submit" class="btn btn-primary">取消</button>
                                                <button type="submit" class="btn btn-success">提交</button>
                                            </div>
                                        </div>

                                        {{ Form::close() }}
                                        @endif
                                </div>
                            </div>
                        </div>

                        <br />
                        <br />
                        <br />

                    </div>
                </div>

                <!-- footer content -->

                <footer>
                    <div class="">
                        <p class="pull-right">Copyright 2016 ganglian.com All rights reserved. |
                            <span class="lead"> <i class="fa fa-logo-footer"></i> 钢链网后台管理系统</span>
                        </p>
                    </div>
                    <div class="clearfix"></div>
                </footer>
                <!-- /footer content -->
            </div>
            <!-- /page content -->

        </div>
    </div>

    <div id="custom_notifications" class="custom-notifications dsp_none">
        <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
        </ul>
        <div class="clearfix"></div>
        <div id="notif-group" class="tabbed_notifications"></div>
    </div>
    </body>
@stop